const express = require("express");
const router = express.Router();
const { findDB, addDB, delDB, updateDB } = require("../models/db.js")

router.get("/findUser", async(req, res) => {
    let result = await findDB();
    res.json(result)
})


router.get("/addUser", async(req, res) => {
    let result = await addDB(req.query);
    res.json(result)
})

router.get("/delUser", async(req, res) => {
    let result = await delDB(req.query);
    res.json(result)
})

router.get("/updateUser", async(req, res) => {
    let result = await updateDB(req.query)
    res.json(result)
})

module.exports = router;